<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <!-- 设置标题，加上小组logo，logo无法加载出来-->
    <link rel="shortcut icon" href="/statics/images/logo.png" type="image/x-icon">
    <title>登录</title>

    <!-- 导入js、css文件-->
    <link href="/statics/css/login.css" type="text/css" rel="stylesheet">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>

</head>
<body>
<div class="name">
    企业跨组织人才管理系统
</div>
<div class="login">
    <p style="text-align:center">
        <img src="/statics/images/logo.jpg" width="128" height="86.4" >
    </p>
    <div class="message">人云易耘-登录</div>
    <div id="darkbannerwrap"></div>
    <input type="text" id="username" placeholder="手机号"><br/>
    <hr class="hr15">
    <input type="password" id="password" placeholder="密码"><br/>
    <hr class="hr15">
    <input type="submit" value="登录" id="login">
    <hr class="hr15">
    <a href="register.html"><input type="button" value="注册"></a>
</div>





</body>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
<script>
    $(function () {
        $("#login").click(function () {
            let username=$("#username").val().trim();
            let password=$("#password").val().trim();
            if (username==null||username==''){
                alert("用户名不能为空");
                return;
            }
            if (password==null||password==''){
                alert("密码不能为空");
                return;
            };
            var obj=new Object();
            obj.username=username;
            obj.password=password;
            $.ajax({
                url:'login',
                type:'post',
                data:obj,
                success :function (result) {
                    if (result.code == 0) {//登录成功
                        location.href="index.html";
                    } else {
                        alert(result.msg);
                    }
                }
            });
        })

    })
</script>
</html>